﻿#ifndef PAGE5_H
#define PAGE5_H

#include "FinanceDialog.h"
#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include <QTableWidget>
#include <QApplication>
#include <QHeaderView>
#include <QVBoxLayout>
#include <QChartView>
#include <QtCharts/QChart>
#include <QMap>
#include <QList>
#include <QVariant>

using namespace QtCharts;

class Page5 : public QWidget
{
    Q_OBJECT

public:
    explicit Page5(QWidget* parent = nullptr);

signals:
    void orderRequested();
    void productionRequested();
    void storeRequested();
    void financeRequested();
    void pageRequested10();
    void pageRequested11();
    void pageRequested12();
    void addEmployeeRequested();
    void pageRequested13();
    void pageRequested1();
public slots:
    void financeHide();
    void signuphide();
    void openFinanceDialog();
    void generateQuarterlyReport();
      void onFrontButtonClicked();

private:
    QPushButton* orderButton;          // 订单按钮
    QPushButton* warehouseButton;      // 仓库按钮
    QPushButton* productionButton;     // 生产按钮
    QPushButton* financeButton;        // 财务按钮
    QPushButton* nextButton;
    QPushButton* addEmployeeButton;
    QPushButton*spendButton;
    QPushButton* creditingButton;
    QPushButton*extantButton;
    QPushButton* helpButton;
    QTableWidget* tableWidget;
        QPushButton* frontButton;
    void clearOldChart();
    QVBoxLayout *mainLayout;
    QChartView *chartView;
QPushButton*connectButton;//连接按钮
    int getQuarter(const QString &dateStr);
    void processFinanceData(const QList<QList<QVariant>> &records,
    QMap<int, double> &totalIncome,
     QMap<int, double> &totalExpense);

};

#endif // page5_H
